<template>
  <div class="container">
    <h2>接触进口冷链食品统计分析</h2>
    <div class="row">
      <!-- <el-select
          v-model="query.testing"
          :clearable="false"
          size="small"
          placeholder="请选择单位状态"
        >
          <el-option label="1日1检" value="1"></el-option>
          <el-option label="2日1检"  value="2"></el-option>
          <el-option label="28日1检"  value="3"></el-option>
        </el-select> -->
      <div class="sizeDiv"></div>

      <el-select size="small" v-model="query.areaCode" placeholder="地区">
        <el-option
          v-for="item in areaOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
      <div class="sizeDiv"></div>
      <el-date-picker
        :picker-options="pickerOptions"
        v-model="query.endDateCompletion"
        type="date"
        size="small"
        width="100%"
        value-format="yyyy-MM-dd"
        :clearable="false"
      >
      </el-date-picker>
      <div class="sizeDiv"></div>

      <el-cascader
        :options="statusOptions"
        v-model="query.bodyindustryStr"
        size="small"
        :props="{ checkStrictly: true }"
        placeholder="请选择单位业态"
        clearable
        @change="handelCascader"
      >
      </el-cascader>
      <div class="sizeDiv"></div>
      <el-cascader
        clearable
        placeholder="请选择标签类别"
        size="small"
        v-model="categoryStr"
        :options="bodyindustryList"
        @change="onCascaderChange"
        :props="{
          checkStrictly: true,
        }"
      ></el-cascader>
      <div class="sizeDiv"></div>
      <el-input
        size="small"
        maxlength="50"
        v-model="query.search"
        placeholder="企业单位名称/统一社会信用代码"
        clearable
      ></el-input>
      <div class="sizeDiv"></div>
      <el-button
        type="primary"
        size="small"
        @click="
          query.pageIndex = 1;
          getList();
        "
      >
        查询
      </el-button>
      <div class="sizeDiv"></div>

      <el-button size="small" @click="exportTable"> 导出 </el-button>
    </div>
    <rz-height></rz-height>
    <rz-height></rz-height>
    <el-tabs
      type="border-card"
      v-model="tabName"
      @tab-click="
        query.pageIndex = 1;
        getList();
      "
    >
      <el-tab-pane label="区域统计" name="1" v-loading="loading">
        <el-table
          border
          stripe
          :data="list"
          style="width: 100%"
          class="region"
          row-key="id"
          :tree-props="{ children: 'children' }"
        >
          <el-table-column
            prop="districtName"
            label="区域名称"
            align="center"
            width="180px"
          >
          </el-table-column>
          <el-table-column
            prop="registerTotal"
            label="注册单位数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/unitInfo',
                  query: {
                    code: scope.row.districtCode || query.areaCode,
                    isLink: true,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    categoryOne: query.categoryOne || '',
                    categoryTwo: query.categoryTwo || '',
                  },
                }"
                v-if="scope.row.registerTotal && scope.row.type == '合计'"
                tag="a"
                >{{ scope.row.registerTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.registerTotal && scope.row.type != '合计'"
                @click="dialogCompanyHandle(scope.row)"
              >
                {{ scope.row.registerTotal }}
              </div>
              <div v-else>{{ scope.row.registerTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="shouldAdoptTotal"
            label="应落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.shouldAdoptTotal"
                tag="a"
                >{{ scope.row.shouldAdoptTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.shouldAdoptTotal && scope.row.type != '合计'"
                @click="dialogData(scope.row, 1)"
              >
                {{ scope.row.shouldAdoptTotal }}
              </div>
              <div v-else>{{ scope.row.shouldAdoptTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="nucleicAcidBatchTotal"
            label="实际落实人数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.nucleicAcidBatchTotal"
                tag="a"
                >{{ scope.row.nucleicAcidBatchTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="
                  scope.row.nucleicAcidBatchTotal && scope.row.type != '合计'
                "
                @click="dialogData(scope.row, 2)"
              >
                {{ scope.row.nucleicAcidBatchTotal }}
              </div>
              <div v-else>{{ scope.row.nucleicAcidBatchTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="notImplementedTotal"
            label="未落实人数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '0',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                  },
                }"
                v-if="scope.row.notImplementedTotal"
                tag="a"
                class="red"
                >{{ scope.row.notImplementedTotal }}</router-link
              > -->
              <div
                class="navigator red"
                v-if="scope.row.notImplementedTotal && scope.row.type != '合计'"
                @click="dialogData(scope.row, 3)"
              >
                {{ scope.row.notImplementedTotal }}
              </div>

              <div v-else class="red">{{ scope.row.notImplementedTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="supplementaryRecordingTotal"
            label="延期补录批次数"
            align="center"
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '2',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: $moment(query.endDateCompletion)
                      .subtract(
                        scope.row.type == '1日1检'
                          ? 1
                          : scope.row.type == '2日1检'
                          ? 2
                          : 3,
                        'days'
                      )
                      .format('YYYY-MM-DD'),
                    categoryOne: query.categoryOne || '',
                    categoryTwo: query.categoryTwo || '',
                  },
                }"
                v-if="
                  scope.row.supplementaryRecordingTotal &&
                  scope.row.type != '合计'
                "
                tag="a"
                class="red"
                >{{ scope.row.supplementaryRecordingTotal }}</router-link
              >
              <div class="red" v-else>
                {{ scope.row.supplementaryRecordingTotal }}
              </div>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="单位业态统计" name="2" v-loading="loading">
        <el-table
          border
          stripe
          :data="list"
          style="width: 100%"
          class="format"
          row-key="id"
          :tree-props="{ children: 'children' }"
        >
          <el-table-column
            prop="bodyindustryStr"
            label="单位业态"
            align="center"
            width="160px"
          >
          </el-table-column>
          <!-- <el-table-column
            prop="bodyindustryremarks"
            label="单位业态备注"
            align="center"
            show-overflow-tooltip
            width="130px"
          >
            <template slot-scope="scope">
              <span>{{ scope.row.bodyindustryremarks || "--" }}</span>
            </template>
          </el-table-column> -->
          <el-table-column
            prop="registerTotal"
            label="注册单位数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/unitInfo',
                  query: {
                    isLink: true,
                    code:  query.areaCode,
                    search: query.search,
                    bodyindustry: scope.row.bodyindustry=='合计'?'':scope.row.bodyindustry || query.bodyindustry,
                    bodyindustryremarks:
                      scope.row.bodyindustryremarks ||
                      query.bodyindustryremarks,
                    categoryOne: query.categoryOne || '',
                    categoryTwo: query.categoryTwo || '',
                  },
                }"
                v-if="scope.row.registerTotal && scope.row.type == '合计'"
                tag="a"
                >{{ scope.row.registerTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.registerTotal && scope.row.type != '合计'"
                @click="dialogCompanyHandle(scope.row)"
              >
                {{ scope.row.registerTotal }}
              </div>
              <div v-else>{{ scope.row.registerTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="shouldAdoptTotal"
            label="应落实人数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/unitInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: scope.row.bodyindustry || query.bodyindustry,
                    bodyindustryremarks:
                      scope.row.bodyindustryremarks ||
                      query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.shouldAdoptTotal"
                tag="a"
                >{{ scope.row.shouldAdoptTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.shouldAdoptTotal && scope.row.type != '合计'"
                @click="dialogData(scope.row, 1)"
              >
                {{ scope.row.shouldAdoptTotal }}
              </div>
              <div v-else>{{ scope.row.shouldAdoptTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="nucleicAcidBatchTotal"
            label="实际落实人数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: scope.row.bodyindustry || query.bodyindustry,
                    bodyindustryremarks:
                      scope.row.bodyindustryremarks ||
                      query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.nucleicAcidBatchTotal"
                tag="a"
                >{{ scope.row.nucleicAcidBatchTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="
                  scope.row.nucleicAcidBatchTotal && scope.row.type != '合计'
                "
                @click="dialogData(scope.row, 2)"
              >
                {{ scope.row.nucleicAcidBatchTotal }}
              </div>
              <div v-else>{{ scope.row.nucleicAcidBatchTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="notImplementedTotal"
            label="未落实人数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '0',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                  },
                }"
                v-if="scope.row.notImplementedTotal"
                tag="a"
                class="red"
                >{{ scope.row.notImplementedTotal }}</router-link
              > -->
              <div
                class="navigator red"
                v-if="scope.row.notImplementedTotal && scope.row.type != '合计'"
                @click="dialogData(scope.row, 3)"
              >
                {{ scope.row.notImplementedTotal }}
              </div>
              <div v-else class="red">{{ scope.row.notImplementedTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="supplementaryRecordingTotal"
            label="延期补录批次数"
            align="center"
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: query.areaCode,
                    search: query.search,
                    bodyindustry:
                      scope.row.bodyindustry == '合计'
                        ? ''
                        : scope.row.bodyindustry || query.bodyindustry,
                    bodyindustryremarks:
                      scope.row.bodyindustryremarks ||
                      query.bodyindustryremarks,
                    status: '2',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: $moment(query.endDateCompletion)
                      .subtract(
                        scope.row.type == '1日1检'
                          ? 1
                          : scope.row.type == '2日1检'
                          ? 2
                          : 3,
                        'days'
                      )
                      .format('YYYY-MM-DD'),
                    categoryOne: query.categoryOne || '',
                    categoryTwo: query.categoryTwo || '',
                  },
                }"
                v-if="
                  scope.row.supplementaryRecordingTotal &&
                  scope.row.type != '合计'
                "
                tag="a"
                class="red"
                >{{ scope.row.supplementaryRecordingTotal }}</router-link
              >
              <div v-else class="red">
                {{ scope.row.supplementaryRecordingTotal }}
              </div>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="单位标签统计" name="5" v-loading="loading">
        <el-table
          border
          stripe
          :data="list"
          style="width: 100%"
          row-key="id"
          class="statistics"
          :tree-props="{ children: 'children' }"
        >
          <el-table-column
            prop="categoryOneStr"
            label="单位标签"
            align="center"
            width="300px"
          >
          </el-table-column>
          <el-table-column
            prop="registerTotal"
            label="注册单位数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/unitInfo',
                  query: {
                    isLink: true,
                    code: query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    categoryOne:scope.row.categoryOne=='合计'?'':scope.row.categoryOne?scope.row.categoryOne.split('-')[0] : '',
                    categoryTwo: scope.row.categoryOne?scope.row.categoryOne.split('-')[1] : '',
                  },
                }"
                v-if="scope.row.registerTotal && scope.row.type == '合计'"
                tag="a"
                >{{ scope.row.registerTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.registerTotal && scope.row.type != '合计'"
                @click="dialogCompanyHandle(scope.row)"
              >
                {{ scope.row.registerTotal }}
              </div>
              <div v-else>{{ scope.row.registerTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="shouldAdoptTotal"
            label="应落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    categoryOne: scope.row.categoryTwo
                      ? scope.row.categoryOne1
                      : scope.row.categoryOne == '合计'
                      ? ''
                      : scope.row.categoryOne || '',
                    categoryTwo: scope.row.categoryTwo || '',
                  },
                }"
                v-if="scope.row.shouldAdoptTotal"
                tag="a"
                >{{ scope.row.shouldAdoptTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.shouldAdoptTotal && scope.row.type != '合计'"
                @click="dialogData(scope.row, 1)"
              >
                {{ scope.row.shouldAdoptTotal }}
              </div>

              <div v-else>{{ scope.row.shouldAdoptTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="nucleicAcidBatchTotal"
            label="实际落实人数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    categoryOne: scope.row.categoryTwo
                      ? scope.row.categoryOne1
                      : scope.row.categoryOne == '合计'
                      ? ''
                      : scope.row.categoryOne || '',
                    categoryTwo: scope.row.categoryTwo || '',
                  },
                }"
                v-if="scope.row.nucleicAcidBatchTotal"
                tag="a"
                >{{ scope.row.nucleicAcidBatchTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="
                  scope.row.nucleicAcidBatchTotal && scope.row.type != '合计'
                "
                @click="dialogData(scope.row, 2)"
              >
                {{ scope.row.nucleicAcidBatchTotal }}
              </div>

              <div v-else>{{ scope.row.nucleicAcidBatchTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="notImplementedTotal"
            label="未落实人数"
            align="center"
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '0',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                  },
                }"
                v-if="scope.row.notImplementedTotal"
                tag="a"
                class="red"
                >{{ scope.row.notImplementedTotal }}</router-link
              > -->
              <div
                class="navigator red"
                v-if="scope.row.notImplementedTotal && scope.row.type != '合计'"
                @click="dialogData(scope.row, 3)"
              >
                {{ scope.row.notImplementedTotal }}
              </div>

              <div v-else class="red">{{ scope.row.notImplementedTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="supplementaryRecordingTotal"
            label="延期补录批次数"
            align="center"
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    categoryOne:
                      scope.row.categoryOne == '合计'
                        ? ''
                        : scope.row.categoryOne
                        ? scope.row.categoryOne.split('-')[0]
                        : '',
                    categoryTwo: scope.row.categoryOne
                      ? scope.row.categoryOne.split('-')[1]
                      : '',
                    status: '2',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: $moment(query.endDateCompletion)
                      .subtract(
                        scope.row.type == '1日1检'
                          ? 1
                          : scope.row.type == '2日1检'
                          ? 2
                          : 3,
                        'days'
                      )
                      .format('YYYY-MM-DD'),
                  },
                }"
                v-if="
                  scope.row.supplementaryRecordingTotal &&
                  scope.row.type != '合计'
                "
                tag="a"
                class="red"
                >{{ scope.row.supplementaryRecordingTotal }}</router-link
              >
              <div v-else class="red">
                {{ scope.row.supplementaryRecordingTotal }}
              </div>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="注册单位统计" name="3" v-loading="loading" v-if="false">
        <el-table border stripe :data="list" style="width: 100%">
          <el-table-column
            prop="districtStreet"
            label="区域街道"
            align="center"
            show-overflow-tooltip
            width="170px"
          >
          </el-table-column>
          <el-table-column
            prop="bodyindustry"
            label="单位业态"
            align="center"
            show-overflow-tooltip
            width="130px"
          >
          </el-table-column>
          <el-table-column
            prop="bodyindustryremarks"
            label="单位业态备注"
            align="center"
            show-overflow-tooltip
            width="180px"
          >
            <template slot-scope="scope">
              <span>
                {{ scope.row.bodyindustryremarks || "--" }}
              </span>
            </template>
          </el-table-column>
          <el-table-column
            prop="identify"
            label="统一社会信用代码"
            align="center"
            show-overflow-tooltip
            width="170px"
          >
          </el-table-column>
          <el-table-column
            prop="unitname"
            label="注册单位名称"
            align="center"
            show-overflow-tooltip
            width="190px"
          >
          </el-table-column>
          <el-table-column
            prop="newlicenseno"
            label="许可证编号"
            align="center"
            show-overflow-tooltip
            width="150px"
          >
            <template slot-scope="scope">
              <span>
                {{ scope.row.newlicenseno || "--" }}
              </span>
            </template>
          </el-table-column>

          <el-table-column
            prop="unitname"
            label="单位标签"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <span v-if="!scope.row.categoryTwo && !scope.row.categoryOne"
                >--</span
              >
              <span v-if="!scope.row.categoryTwo">{{
                scope.row.categoryOne
              }}</span>
              <span v-else>{{
                scope.row.categoryOne + "--" + scope.row.categoryTwo
              }}</span>
            </template>
          </el-table-column>
          <el-table-column
            prop="shouldAdoptTotal"
            label="应落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: scope.row.unitname || query.search,
                    bodyindustry: scope.row.bodyindustry || query.bodyindustry,
                    bodyindustryremarks:
                      scope.row.bodyindustryremarks ||
                      query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.shouldAdoptTotal"
                tag="a"
                >{{ scope.row.shouldAdoptTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.shouldAdoptTotal"
                @click="dialogData(scope.row, 1)"
              >
                {{ scope.row.shouldAdoptTotal }}
              </div>

              <div v-else>{{ scope.row.shouldAdoptTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="nucleicAcidBatchTotal"
            label="实际落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: scope.row.unitname || query.search,
                    bodyindustry: scope.row.bodyindustry || query.bodyindustry,
                    bodyindustryremarks:
                      scope.row.bodyindustryremarks ||
                      query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.nucleicAcidBatchTotal"
                tag="a"
                >{{ scope.row.nucleicAcidBatchTotal }}</router-link
              > -->
              <div
                class="navigator"
                v-if="scope.row.nucleicAcidBatchTotal"
                @click="dialogData(scope.row, 2)"
              >
                {{ scope.row.nucleicAcidBatchTotal }}
              </div>

              <div v-else>{{ scope.row.nucleicAcidBatchTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="notImplementedTotal"
            label="未落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <!-- <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '0',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                  },
                }"
                v-if="scope.row.notImplementedTotal"
                tag="a"
                class="red"
                >{{ scope.row.notImplementedTotal }}</router-link
              > -->
              <div
                class="navigator red"
                v-if="scope.row.notImplementedTotal"
                @click="dialogData(scope.row, 3)"
              >
                {{ scope.row.notImplementedTotal }}
              </div>

              <div v-else class="red">{{ scope.row.notImplementedTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="supplementaryRecordingTotal"
            label="延期补录批次数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: scope.row.unitname || query.search,
                    bodyindustry: scope.row.bodyindustry || query.bodyindustry,
                    bodyindustryremarks:
                      scope.row.bodyindustryremarks ||
                      query.bodyindustryremarks,
                    status: '2',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: $moment(query.endDateCompletion)
                      .subtract(
                        scope.row.type == '1日1检'
                          ? 1
                          : scope.row.type == '2日1检'
                          ? 2
                          : 3,
                        'days'
                      )
                      .format('YYYY-MM-DD'),
                    categoryOne:
                      scope.row.categoryOne || query.categoryOne || '',
                    categoryTwo:
                      scope.row.categoryTwo || query.categoryTwo || '',
                  },
                }"
                v-if="scope.row.supplementaryRecordingTotal"
                tag="a"
                class="red"
                >{{ scope.row.supplementaryRecordingTotal }}</router-link
              >
              <div v-else class="red">
                {{ scope.row.supplementaryRecordingTotal }}
              </div>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          :total="total"
          @pagination="getList"
          :page.sync="query.pageIndex"
        />
      </el-tab-pane>
      <!-- <el-tab-pane label="按日期分析" name="4" v-loading="loading" class="date">
       <el-radio-group  @change="getList">
        <el-radio v-model="query.category" @change="getList" :label="-1"
          >日报</el-radio
        >
        <el-radio v-model="query.category" @change="getList" :label="1"
          >月报</el-radio
        >
        <el-select
          v-if="query.category === 1"
          size="small"
          v-model="query.year"
          placeholder="年份"
          style="margin: 0 20px"
        >
          <el-option
            v-for="item in yearOptions"
            :key="item.value"
            :label="item.value"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <el-radio v-model="query.category" @change="getList" :label="2"
          >年报</el-radio
        >
        <rz-height />
        <el-table border stripe :data="list" style="width: 100%">
          <el-table-column prop="categoryDate" label="日期类别" align="center">
          </el-table-column>
          <el-table-column
            prop="shouldAdoptTotal"
            label="应落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.shouldAdoptTotal"
                tag="a"
                >{{ scope.row.shouldAdoptTotal }}</router-link
              >
              <div v-else>{{ scope.row.shouldAdoptTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="nucleicAcidBatchTotal"
            label="实际落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/personInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                  },
                }"
                v-if="scope.row.nucleicAcidBatchTotal"
                tag="a"
                >{{ scope.row.nucleicAcidBatchTotal }}</router-link
              >
              <div v-else>{{ scope.row.nucleicAcidBatchTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="notImplementedTotal"
            label="未落实人数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '0',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                  },
                }"
                v-if="scope.row.notImplementedTotal"
                tag="a"
                class="red"
                >{{ scope.row.notImplementedTotal }}</router-link
              >
              <div v-else class="red">{{ scope.row.notImplementedTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="supplementaryRecordingTotal"
            label="延期补录批次数"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '2',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                  },
                }"
                v-if="scope.row.supplementaryRecordingTotal"
                tag="a"
                class="red"
                >{{ scope.row.supplementaryRecordingTotal }}</router-link
              >
              <div v-else class="red">
                {{ scope.row.supplementaryRecordingTotal }}
              </div>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane> -->
      <!-- <el-tab-pane label="按人员统计" name="6" v-loading="loading">
        <el-table border stripe :data="list" style="width: 100%" class="region">
     
          <el-table-column
            prop="superviseUnitName"
            label="单位名称"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="personName"
            label="员工姓名"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="shouldAdoptTotal"
            label="应落实批次数"
            align="center"
          >
            <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                    searchOne: scope.row.personName,
                    searchTwo: scope.row.superviseUnitName,
                  },
                }"
                v-if="scope.row.shouldAdoptTotal"
                tag="a"
                >{{ scope.row.shouldAdoptTotal }}</router-link
              >
              <div v-else>{{ scope.row.shouldAdoptTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="nucleicAcidBatchTotal"
            label="实际落实批次数"
            align="center"
          >
         <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                    searchOne: scope.row.personName,
                    searchTwo: scope.row.superviseUnitName,
                        status: '1',
                  },
                }"
                v-if="scope.row.nucleicAcidBatchTotal"
                tag="a"
                >{{ scope.row.nucleicAcidBatchTotal }}</router-link
              >
              <div v-else>{{ scope.row.nucleicAcidBatchTotal }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="notImplementedTotal"
            label="未落实批次数"
            align="center"
          >
          <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '2',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                    searchOne: scope.row.personName,
                    searchTwo: scope.row.superviseUnitName,
                  },
                }"
                v-if="scope.row.notImplementedTotal"
                tag="a"
                class="red"
                >{{ scope.row.notImplementedTotal }}</router-link
              >
              <div class="red" v-else>{{ scope.row.notImplementedTotal }}</div>
            </template> 
          </el-table-column>
          <el-table-column
            prop="supplementaryRecordingTotal"
            label="延期补录批次数"
            align="center"
          >
          <template slot-scope="scope">
              <router-link
                :to="{
                  path: '/collectionInfo',
                  query: {
                    isLink: true,
                    code: scope.row.districtCode || query.areaCode,
                    search: query.search,
                    bodyindustry: query.bodyindustry,
                    bodyindustryremarks: query.bodyindustryremarks,
                    status: '0',
                    endDateCompletion: query.endDateCompletion,
                    startDateCompletion: query.startDateCompletion,
                    searchOne: scope.row.personName,
                    searchTwo: scope.row.superviseUnitName,
                  },
                }"
                v-if="scope.row.supplementaryRecordingTotal"
                tag="a"
                class="red"
                >{{ scope.row.supplementaryRecordingTotal }}</router-link
              >
              <div class="red" v-else>
                {{ scope.row.supplementaryRecordingTotal }}
              </div>
            </template> 
          </el-table-column>
        </el-table>
        <pagination
          :total="total"
          @pagination="getList"
          :page.sync="query.pageIndex"
        />
      </el-tab-pane> -->
    </el-tabs>
    <list
      :dialogVisible="dialogVisible"
      v-if="dialogVisible"
      :params="params"
      @oncancel="dialogVisible = false"
    ></list>

    <company
     :dialogVisible="dialogCompany"
      v-if="dialogCompany"
      :params="params"
      @oncancel="dialogCompany = false"
    ></company>
  </div>
</template>
<script>
import { groupArea } from "@/api/modules/enterprise";
import list from "@/views/coldLink/analysis/list";
import company from "@/views/coldLink/analysis/company";

import { bodyIndustryOptions, bodyIndustryLabel } from "@/utils/configure";
import {
  findBodyindustryNewStatistics,
  findRegisteredUnitNewStatistics,
  findNucleicAcidCollectionDateNewStatistics,
  findRegionalStatisticsNew,
  findCategoryNewStatistics,
  exportRegisteredUnitNewStatistics,
  exportRegionalStatisticsNew,
  exportCategoryNewStatistics,
  findBatchNumberNewStatistics,
  exportBodyindustryNewStatistics,
} from "@/api/modules/coldLink";
import { exportTb } from "@/utils/XLSX";
export default {
  name: "statisticsInfo",
  created() {
    this.query.areaCode = this.$route.query.code || "320500";
    for (let i = 2022; i <= new Date().getFullYear(); i++) {
      this.yearOptions.push({
        value: i,
      });
    }
    // this.selectedDate = [
    //   this.$moment().subtract(1, "days").format("YYYY-MM-DD"),
    //   this.$moment().subtract(1, "days").format("YYYY-MM-DD"),
    // ];
    // this.query.startDateCompletion = this.selectedDate[0];
    this.query.endDateCompletion = this.$moment()
      .subtract(1, "days")
      .format("YYYY-MM-DD");
    this.findAreaListNoParentByParentCode();
    this.getList();
  },
  // 页面加载完成
  mounted() {},
  //实例销毁之前
  beforeDestroy() {},
  //实例销毁后
  destroyed() {},
  data() {
    return {
      params: {},
      dialogVisible: false,
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
      },
      tabName: "1",
      list: [],
      areaOptions: [], //区域列表
      statusOptions: bodyIndustryOptions,
      query: {
        areaCode: "",
        bodyindustry: "",
        bodyindustryStr: "",
        bodyindustryremarks: "",
        categoryOne: "",
        categoryTwo: "",
        endDateCompletion: "",
        search: "",
        startDateCompletion: "2020-01-01",
        isPage: 0,
        pageIndex: 1,
        pageSize: 10,
        category: -1,
        year: new Date().getFullYear(),
        // testing: "1",
      },
      categoryStr: "",
      selectedDate: "",
      total: 0,
      yearOptions: [],
      loading: false,
      bodyindustryList: bodyIndustryLabel.list,
      dialogCompany:false,
    };
  },
  // 方法
  methods: {
    findAreaListNoParentByParentCode() {
      groupArea({
        params: this.query,
      }).then((res) => {
        this.areaOptions.push({
          label: res.data.areaName,
          value: res.data.areaCode,
        });
        res.data.children.forEach((item1) => {
          this.areaOptions.push({
            label: item1.areaName,
            value: item1.areaCode,
          });
        });
      });
    },
    //选择日期
    // handelChangeDate(e) {
    //   // if (e[0] == e[1]) {
    //   //   this.selectedDate = [
    //   //     this.$moment(e[0]).subtract(1, "day").format("YYYY-MM-DD"),
    //   //     e[1],
    //   //   ];
    //   //   this.query.startDateCompletion = this.$moment(e[0])
    //   //     .subtract(1, "day")
    //   //     .format("YYYY-MM-DD");
    //   //   this.query.endDateCompletion = e[1];
    //   //   return this.$error("开始和结束日期不能同一天");
    //   // }
    //   if (e) {
    //     this.query.startDateCompletion = e[0];
    //     this.query.endDateCompletion = e[1];
    //   } else {
    //     this.query.startDateCompletion = "";
    //     this.query.endDateCompletion = "";
    //   }
    // },
    handelCascader(e) {
      if (e.length == 1) {
        this.query.bodyindustry = e[0];
        this.query.bodyindustryremarks = "";
      } else if (e.length == 2) {
        this.query.bodyindustry = e[0];
        this.query.bodyindustryremarks = e[1];
      } else {
        this.query.bodyindustry = "";
        this.query.bodyindustryremarks = "";
        this.query.bodyindustryStr = "";
      }
    },
    getList() {
      this.loading = true;
      if (this.tabName == 1) {
        this.findRegionalStatisticsNew();
      } else if (this.tabName == 2) {
        this.findBodyindustryNewStatistics();
      } else if (this.tabName == 3) {
        this.findRegisteredUnitNewStatistics();
      } else if (this.tabName == 4) {
        this.findNucleicAcidCollectionDateNewStatistics();
      } else if (this.tabName == 5) {
        this.findCategoryNewStatistics();
      } else if (this.tabName == 6) {
        this.findBatchNumberNewStatistics();
      }
    },
    findBodyindustryNewStatistics() {
      findBodyindustryNewStatistics(this.query).then((res) => {
        res.data.forEach((x) => {
          x.bodyindustryStr = x.bodyindustry;
          x.id = this.$_.uniqueId();
          if (x.bodyindustryStatisticsNew1ResponseList) {
            x.bodyindustryStatisticsNew1ResponseList.forEach((z) => {
              z.id = this.$_.uniqueId();
              z.bodyindustryStr = z.type;
            });
            x.children = x.bodyindustryStatisticsNew1ResponseList;
          }
        });
        this.list = res.data;
        res.data.forEach((x) => {
          if (x.bodyindustryremarks.includes("托育（托幼）")) {
            x.bodyindustryremarks = "幼托机构食堂";
          } else if (x.bodyindustryremarks.includes("学校")) {
            x.bodyindustryremarks = "学校食堂";
          }
        });
        this.loading = false;
      });
    },
    findRegisteredUnitNewStatistics() {
      findRegisteredUnitNewStatistics(this.query).then((res) => {
        this.list = res.data.list;
        this.total = res.data.total;
        this.loading = false;
      });
    },
    findNucleicAcidCollectionDateNewStatistics() {
      findNucleicAcidCollectionDateNewStatistics(this.query).then((res) => {
        this.list = res.data;
        this.loading = false;
      });
    },
    findBatchNumberNewStatistics() {
      findBatchNumberNewStatistics(this.query).then((res) => {
        this.list = res.data.list;
        this.total = res.data.total;
        this.loading = false;
      });
    },
    findRegionalStatisticsNew() {
      findRegionalStatisticsNew(this.query).then((res) => {
        res.data.forEach((x) => {
          x.id = this.$_.uniqueId();
          if (x.regionalStatisticsNew1ResponseList) {
            x.regionalStatisticsNew1ResponseList.forEach((z) => {
              z.id = this.$_.uniqueId();
              z.districtName = z.type;
            });
            x.children = x.regionalStatisticsNew1ResponseList;
          }
        });
        this.list = res.data;
        this.loading = false;
      });
    },
    findCategoryNewStatistics() {
      findCategoryNewStatistics(this.query).then((res) => {
        res.data.forEach((x) => {
          x.categoryOneStr = x.categoryOne;
          x.id = this.$_.uniqueId();
          if (x.categoryStatisticsNew1ResponseList) {
            x.categoryStatisticsNew1ResponseList.forEach((z) => {
              z.id = this.$_.uniqueId();
              z.categoryOneStr = z.type;
            });
            x.children = x.categoryStatisticsNew1ResponseList;
          }
        });
        this.list = res.data;
        this.loading = false;
      });
    },
    exportTable() {
      let time = new Date().getTime();
      if (this.tabName == 1) {
        // exportTb(".region", `区域统计导出${time}`);
        exportRegionalStatisticsNew({
          areaCode: this.query.areaCode,
          bodyindustry: this.query.bodyindustry,
          bodyindustryremarks: this.query.bodyindustryremarks,
          categoryOne: this.query.categoryOne,
          categoryTwo: this.query.categoryTwo,
          search: this.query.search,
          endDateCompletion: this.query.endDateCompletion,
        }).then((res) => {
          var blob = new Blob([res], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
          var downloadElement = document.createElement("a");
          var href = window.URL.createObjectURL(blob); //创建下载的链接
          downloadElement.href = href;
          downloadElement.download =
            "注册单位统计" + new Date().getTime() + ".xlsx"; //下载后文件名
          document.body.appendChild(downloadElement);
          downloadElement.click(); //点击下载
          document.body.removeChild(downloadElement); //下载完成移除元素
          window.URL.revokeObjectURL(href); //释放掉blob对象
        });
      } else if (this.tabName == 2) {
        // exportTb(".format", `单位业态统计导出${time}`);

        exportBodyindustryNewStatistics({
          areaCode: this.query.areaCode,
          bodyindustry: this.query.bodyindustry,
          bodyindustryremarks: this.query.bodyindustryremarks,
          categoryOne: this.query.categoryOne,
          categoryTwo: this.query.categoryTwo,
          search: this.query.search,
          endDateCompletion: this.query.endDateCompletion,
        }).then((res) => {
          var blob = new Blob([res], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
          var downloadElement = document.createElement("a");
          var href = window.URL.createObjectURL(blob); //创建下载的链接
          downloadElement.href = href;
          downloadElement.download =
            "单位业态导出" + new Date().getTime() + ".xlsx"; //下载后文件名
          document.body.appendChild(downloadElement);
          downloadElement.click(); //点击下载
          document.body.removeChild(downloadElement); //下载完成移除元素
          window.URL.revokeObjectURL(href); //释放掉blob对象
        });
      } else if (this.tabName == 3) {
        exportRegisteredUnitNewStatistics(this.query).then((res) => {
          var blob = new Blob([res], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
          var downloadElement = document.createElement("a");
          var href = window.URL.createObjectURL(blob); //创建下载的链接
          downloadElement.href = href;
          downloadElement.download =
            "注册单位统计" + new Date().getTime() + ".xlsx"; //下载后文件名
          document.body.appendChild(downloadElement);
          downloadElement.click(); //点击下载
          document.body.removeChild(downloadElement); //下载完成移除元素
          window.URL.revokeObjectURL(href); //释放掉blob对象
        });
      } else if (this.tabName == 4) {
        exportTb(".date", `采样日期分析导出${time}`);
      } else if (this.tabName == 5) {
        // exportTb(".statistics", `单位标签统计导出${time}`);
        exportCategoryNewStatistics({
          areaCode: this.query.areaCode,
          bodyindustry: this.query.bodyindustry,
          bodyindustryremarks: this.query.bodyindustryremarks,
          categoryOne: this.query.categoryOne,
          categoryTwo: this.query.categoryTwo,
          search: this.query.search,
          startDateCompletion: this.query.startDateCompletion,
          endDateCompletion: this.query.endDateCompletion,
          testing: this.query.testing,
        }).then((res) => {
          var blob = new Blob([res], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
          var downloadElement = document.createElement("a");
          var href = window.URL.createObjectURL(blob); //创建下载的链接
          downloadElement.href = href;
          downloadElement.download =
            "单位标签统计" + new Date().getTime() + ".xlsx"; //下载后文件名
          document.body.appendChild(downloadElement);
          downloadElement.click(); //点击下载
          document.body.removeChild(downloadElement); //下载完成移除元素
          window.URL.revokeObjectURL(href); //释放掉blob对象
        });
      }
    },
    dialogData(e, numberOfPeople) {
      // if (e.bodyindustry == "合计") {
      //   e.bodyindustry = "";
      // }
      // if (e.categoryOne == "合计") {
      //   e.categoryOne = "";
      // }

      this.params = {
        areaCode: e.districtCode || this.query.areaCode,
        categoryOne: e.categoryOne
          ? e.categoryOne.split("-")[0]
          : this.query.categoryOne || "",
        categoryTwo: e.categoryOne
          ? e.categoryOne.split("-")[1]
          : this.query.categoryTwo || "",
        bodyindustry: e.bodyindustry || this.query.bodyindustry || "",
        bodyindustryremarks:
          e.bodyindustryremarks || this.query.bodyindustryremarks || "",
        search: e.unitname || this.query.search || "",
        // startDateCompletion: this.query.startDateCompletion,
        endDateCompletion: this.query.endDateCompletion,
        // testing: this.query.testing,
        numberOfPeople,
      };
      if (e.type == "1日1检") {
        this.params.testing = 1;
      } else if (e.type == "2日1检") {
        this.params.testing = 2;
      } else if (e.type == "3日1检") {
        this.params.testing = 3;
      }
      if (e.categoryOne == "合计") {
        this.params.categoryOne = "";
      }
      if (e.bodyindustry == "合计") {
        this.params.bodyindustry = "";
      }
      this.dialogVisible = true;
    },
    onCascaderChange(e) {
      if (e.length == 2) {
        this.query.categoryOne = e[0];
        this.query.categoryTwo = e[1];
      } else if (e.length == 1) {
        this.query.categoryOne = e[0];
        this.query.categoryTwo = "";
      } else {
        this.query.categoryOne = "";
        this.query.categoryTwo = "";
        this.categoryStr = "";
      }
    },
    dialogCompanyHandle(e){
        this.params = {
        areaCode: e.districtCode || this.query.areaCode,
        categoryOne: e.categoryOne
          ? e.categoryOne.split("-")[0]
          : this.query.categoryOne || "",
        categoryTwo: e.categoryOne
          ? e.categoryOne.split("-")[1]
          : this.query.categoryTwo || "",
        bodyindustry: e.bodyindustry || this.query.bodyindustry || "",
        bodyindustryremarks:
          e.bodyindustryremarks || this.query.bodyindustryremarks || "",
        search: e.unitname || this.query.search || "",
        // startDateCompletion: this.query.startDateCompletion,
        endDateCompletion: this.query.endDateCompletion,
        testing: this.query.testing,
      };
      if (e.type == "1日1检") {
        this.params.testing = 1;
      } else if (e.type == "2日1检") {
        this.params.testing = 2;
      }else if (e.type == "3日1检") {
        this.params.testing = 3;
      }
      if (e.categoryOne == "合计") {
        this.params.categoryOne = "";
      }
      if (e.bodyindustry == "合计") {
        this.params.bodyindustry = "";
      }

      this.dialogCompany=true
    }
  },
  // 监听属性
  watch: {
    //    'query.testing': function(newV, oldV) {
    //    if(newV==1){
    //        this.selectedDate = [
    //     this.$moment().subtract(1, "days").format("YYYY-MM-DD"),
    //     this.$moment().subtract(1, "days").format("YYYY-MM-DD"),
    //   ];
    //   this.query.startDateCompletion = this.selectedDate[0];
    //   this.query.endDateCompletion = this.selectedDate[1];
    //    }else if(newV==2){
    //  this.selectedDate = [
    //     this.$moment().subtract(2, "days").format("YYYY-MM-DD"),
    //     this.$moment().subtract(1, "days").format("YYYY-MM-DD"),
    //   ];
    //   this.query.startDateCompletion = this.selectedDate[0];
    //   this.query.endDateCompletion = this.selectedDate[1];
    //    }else if(newV==3){
    //       this.selectedDate = [
    //     this.$moment().subtract(28, "days").format("YYYY-MM-DD"),
    //    this.$moment().subtract(1, "days").format("YYYY-MM-DD"),
    //   ];
    //   this.query.startDateCompletion = this.selectedDate[0];
    //   this.query.endDateCompletion = this.selectedDate[1];
    //    }
    //   },
  },
  // 组件
  components: {
    list,
    company
  },
  // 计算属性
  computed: {},
};
</script>

<style lang="scss" scoped>
.container {
  padding: 20px;
  .el-input {
    width: 250px;
  }
  .sizeDiv {
    width: 10px;
    display: inline-block;
  }
  .row {
    display: flex;
    align-items: center;
  }
  a {
    color: $default;
    text-decoration: underline;
  }
  .el-select {
    margin-left: 0 !important;
  }
  .red {
    color: red !important;
  }
  .navigator {
    cursor: pointer;
    text-decoration: underline;
    color: $default;
  }
}
</style>